using IQIGame.Onigao.Framework;

namespace IQIGame.Onigao.Logic
{
    public class SkillTrigger_SelfStartBattle : SkillTrigger
    {
        protected override ESkillTriggerType triggerType => ESkillTriggerType.SelfBattleStart;

        protected override void OnEnable()
        {
            base.OnEnable();
            this.AddListener(EBattleTriggerType.Battle_BattleStart, this.OnEvent);
        }

        private void OnEvent()
        {
            var rVirInput = ClassPool.Get<SelectParam>();
            rVirInput.unit = this.skill.executer;
            rVirInput.pos = rVirInput.unit.pos;
            this.OnTrigger(rVirInput);
        }

        public override void Free()
        {
            ClassPool.Put(this);
        }

#if UNITY_EDITOR
        public override string ToString()
        {
            return "战斗开始时";
        }
#endif
    }
}